package com.qys.livesMall.open.controller.app;

import com.qys.livesMall.common.result.R;
import com.qys.livesMall.open.modal.dto.app.H2AppUserDeviceDTO;
import com.qys.livesMall.open.service.H2AppUserDeviceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户和设备关联表 前端控制器
 * </p>
 *
 * @author wzy
 * @since 2023-07-07
 */
@RestController
@RequestMapping("/app/user/appUserDevice")
@Tag(name = "用户和设备关联管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class H2AppUserDeviceController {

    private final H2AppUserDeviceService h2AppUserDeviceService;

    @PostMapping("saveUserDevice")
    @Operation(summary = "保存用户和设备关联")
    public R<Void> saveUserDevice(@RequestBody @Validated H2AppUserDeviceDTO dto){
        h2AppUserDeviceService.saveUserDevice(dto);
        return R.ok();
    }
}
